package com.market.vo;

import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * @ClassName R
 * @Description 通用响应结果格式类
 * @Author pq
 * @Date 2022/3/28 22:43
 * @Version 1.0
 */
@Data
public class R<T> {
    private int code;
    private String msg;
    private T data;

    public R(){}

    public R(int code,String msg){
        this.code=code;
        this.msg=msg;
    }
    public  R(int code,String msg,T data){
        this.code=code;
        this.msg=msg;
        this.data=data;
    }
    public static <T> R querySuccess(T data){
        return new R(200,"查询成功",data);
    }
}
